$(function(){
	$(".M-box").pagination({
        showData:13,
        totalData: $('.user .user-title').attr('data-AllCount'),
        coping:true,
        homePage:'首页',
        endPage:'末页',
        prevContent:'上页',
        nextContent:'下页',
        callback:function(api){
        	console.log("当前页："+api.getCurrent());
    		console.log("总页："+api.getPageCount());
        	/* api.setPageCount(getCount());//设置总页数
    		sendData($(".tag"),api.getCurrent()); */
        	$.post('user/jf',{
        		Current:api.getCurrent()
        	},function(data){
        		$('.qq tbody').html("");
        		$.each(JSON.parse(data), function(i, item) {
        			var td1=$("<td>").text(getMyDate(item.ujTime));
        			var td2=$("<td>").text(item.ujScore);
        			var td3=$("<td>").text(item.ujReason);
        			var tr=$("<tr>").append(td1).append(td2).append(td3);
        			$('.qq tbody').append(tr);
        		});
        		$(".user table>tbody>tr:even").css("background", "#fff");
        		$(".user table>tbody>tr:odd").css("background", "#f9f9f9");
        	})
        }
	});
	  //美化表格
	$("table>tbody>tr:even").css("background", "#fff");
	$("table>tbody>tr:odd").css("background", "#f9f9f9");
	//格式化时间
	 function getMyDate(str){  
	    var oDate = new Date(str),  
	    oYear = oDate.getFullYear(),  
	    oMonth = oDate.getMonth()+1,  
	    oDay = oDate.getDate(),  
	    oHour = oDate.getHours(),  
	    oMin = oDate.getMinutes(),  
	    oSen = oDate.getSeconds(),  
	    oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间  
	    return oTime;  
	}; 
	//补0操作  
	function getzf(num){  
	    if(parseInt(num) < 10){  
	        num = '0'+num;  
	    }  
	    return num;  
	} 
});